/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package suministros.ejb30.entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author Diana
 */
@Embeddable
public class CasillaSuministroPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "id_casilla")
    private int idCasilla;
    @Basic(optional = false)
    @Column(name = "id_suministro")
    private String idSuministro;

    public CasillaSuministroPK() {
    }

    public CasillaSuministroPK(int idCasilla, String idSuministro) {
        this.idCasilla = idCasilla;
        this.idSuministro = idSuministro;
    }

    public int getIdCasilla() {
        return idCasilla;
    }

    public void setIdCasilla(int idCasilla) {
        this.idCasilla = idCasilla;
    }

    public String getIdSuministro() {
        return idSuministro;
    }

    public void setIdSuministro(String idSuministro) {
        this.idSuministro = idSuministro;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) idCasilla;
        hash += (idSuministro != null ? idSuministro.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CasillaSuministroPK)) {
            return false;
        }
        CasillaSuministroPK other = (CasillaSuministroPK) object;
        if (this.idCasilla != other.idCasilla) {
            return false;
        }
        if ((this.idSuministro == null && other.idSuministro != null) || (this.idSuministro != null && !this.idSuministro.equals(other.idSuministro))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "suministros.ejb30.entity.CasillaSuministroPK[idCasilla=" + idCasilla + ", idSuministro=" + idSuministro + "]";
    }

}
